import request from '@/utils/request'
import linq from 'linq'
export async function get教师基本情况(XXID,CJPC){
    //
  
    let res =  await request({
        url: `/Jsjbqk?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}' and 审核状态 eq '通过' and (是否删除 eq 0 or 是否删除 eq null)`,
        method: 'get',
        
      })
    return res.data.value;
    //
    
}

export async function bulkAddJsjbqk(data){
  //
  
  let res =  await request({
      url: '/Jsjbqk/BulkAddJsjbqk',
      method: 'post',
      data:data
    })
  return res.data.value;
  //
  
}

export async function get教师基本情况ByGH(XXID,CJPC,gh){
  //

  let res =  await request({
      url: `/Jsjbqk?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}' and (GH eq '${gh}' or XM eq '${gh}') and 审核状态 eq '通过' and (是否删除 eq 0 or 是否删除 eq null)`,
      method: 'get',
    })
  return res.data.value;
  //
  
}
export async function search教师基本情况(XXID,CJPC,search){
  //

  let res =  await request({
      url: `/Jsjbqk?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}' and (contains(GH, '${search}') or contains(XM, '${search}')) and 审核状态 eq '通过' and (是否删除 eq 0 or 是否删除 eq null) `,
      method: 'get',
      
    })
  return res.data.value;
  //
  
}
export async function update教师基本情况(model){
    let res =  await request({
        url: `/Jsjbqk(${model.ID})`,
        method: 'put',
        data: model
      })
      return res.data;
}
export async function delete教师基本情况(model){
    let res = await  request({
        url: `/Jsjbqk/${model.ID}`,
        method: 'delete',
      })
      return res.data;
}
export async function add教师基本情况(model){
   
    let res =  await request({
      url: '/Jsjbqk',
      method: 'post',
      data: model,
    })
    return res.data;
}